import Vue from 'vue';
import VueRouter from 'vue-router';

import User from '@/views/userPage.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: '/user',
    component: User,
    children: [
      {
        path: '/login',
        component: () => import('../components/loginPage.vue'),
      },
      {
        path: '/register',
        component: () => import('../components/registerPage.vue'),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
